package com.lzy.cloud.goods.service.GoodsServiceImpl;

import com.lzy.cloud.goods.dtos.HourCalendarDto;
import com.lzy.cloud.goods.entity.HourCalendar;
import com.lzy.cloud.goods.mapper.HourCalendarMapperExt;
import com.lzy.cloud.goods.service.HourCalendarService;
import com.lzy.framework.core.utils.DozerUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HourCalendarServiceImpl implements HourCalendarService {

    @Autowired
    HourCalendarMapperExt hourCalendarMapperExt;

    @Override
    public Boolean addHourCalendar(HourCalendarDto hourCalendarDto) {
        return hourCalendarMapperExt.insertSelective(DozerUtils.map(hourCalendarDto,HourCalendar.class))>0;
    }

    @Override
    public List<HourCalendarDto> selectList(HourCalendarDto hourCalendarDto) {
        return hourCalendarMapperExt.selectList(hourCalendarDto);
    }

    @Override
    public Boolean deleteByNoOrderType(HourCalendarDto hourCalendarDto) {
        return hourCalendarMapperExt.deleteByNoOrderType(hourCalendarDto)>0;
    }

    @Override
    public Boolean delete(Long id) {
        return hourCalendarMapperExt.deleteByPrimaryKey(id) > 0;
    }
}
